home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
Ubuntu 9.10 PL
/
karmelkowy-koliberek-desktop-9.10-i386-PL.iso
/
casper
/
filesystem.squashfs
/
bin
/
block-attr
< prev
next >
Wrap
Text File
|
2009-06-15
|
495b
|
34 lines
#! /bin/sh
usage () {
echo "Usage: $0 --type|--label|--uuid <device>"
}
case $1 in
--type)
vol_id_opt=--type
blkid_tag=TYPE
;;
--label)
vol_id_opt=--label
blkid_tag=LABEL
;;
--uuid)
vol_id_opt=--uuid
blkid_tag=UUID
;;
*)
usage >&2
exit 1
;;
esac
shift
if (export PATH="/lib/udev:$PATH"; type vol_id) >/dev/null 2>&1; then
PATH="/lib/udev:$PATH" vol_id "$vol_id_opt" "$1"
elif type blkid >/dev/null 2>&1; then
blkid -o value -s "$blkid_tag" "$1"
else
exit 1
fi